package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.ContrastAdjustmentExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 对比度调整算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建ContrastAdjustmentExecutor实例
 */
public class ContrastAdjustmentExecutorFactory implements AlgorithmExecutorFactory {
    private static final ContrastAdjustmentExecutorFactory instance = new ContrastAdjustmentExecutorFactory();

    private ContrastAdjustmentExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return ContrastAdjustmentExecutorFactory实例
     */
    public static ContrastAdjustmentExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        ContrastAdjustmentExecutor contrastAdjustmentExecutor = new ContrastAdjustmentExecutor();
        BeanUtils.copyProperties(param, contrastAdjustmentExecutor);
        return contrastAdjustmentExecutor;
    }
}